﻿@{
    ViewData["Title"] = "职位列表";
}
<div class="layui-layout layui-layout-admin">
    <table id="lsttable" lay-filter="lsttable"></table>
</div>

@section scripts {
    <script type="text/javascript">
        var app = {};
        layui.use(['tools'], function () {
            var tools = layui.tools;

            app.initData = function () {
                //
                var status = ['积压', '就绪', '正在运行', '暂停', '阻塞', '由失败进入就绪', '归档', '崩溃', '超限', '无触发时间', '未启动', '未知作业触发器', '未知作业处理程序']
                let cols =
                    [[
                        { type: 'numbers', title: '序号', width: 60, fixed: 'left' },
                        {
                            field: 'status', title: '状态', width:66, align:'center',templet: function (d) {
                                return '<span class="layui-badge layui-bg-blue">' + status[d.status] + '</span>';
                            }
                        },                        
                        { title: '最近运行时间', field: 'lastRunTime', width: 160 },
                        { title: '耗时', field: 'elapsedTime', width: 80,align:'right' },
                        { title: '下一次运行时间', field: 'nextRunTime', width: 160 },
                        { title: '作业编号', field: 'jobId', width: 120 },
                        { title: '当前运行次数', field: 'numberOfRuns', width: 120, align: 'right' },
                        { title: '执行结果', field: 'result', minWidth: 100 },
                        { title: '触发器编号', field: 'triggerId', width: 160 },
                    ]];
                //
                tools.PageTable({
                    url: '/api/sysJob/pageJobTriggerRecord',
                    cols,
                    before: function (options) {
                        options.where.jobId = '@Context.Request.Query["jobId"]';
                    },
                });
            }();
        })
    </script>
}
